package com.example.qxfw.jtyb.controller;
import com.example.qxfw.common.SysResult;
import com.example.qxfw.common.entity.zy.Traffic;
import com.example.qxfw.jtyb.service.JtybService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "交通预报-交通预报")
@RestController
@CrossOrigin
@RequestMapping("/jtyb")
public class JtybController {
    @Autowired
    private JtybService jtybService;

    @ApiOperation("预报发布")
    @GetMapping("/forecastRelease")
    public SysResult forecastRelease(String date, int forecasttype, String time){
        List<Traffic> list = jtybService.forecastRelease(date, forecasttype, time);
        return SysResult.success(list);
    }

    @ApiOperation("生成模板")
    @RequestMapping("/generateDocx")
    public SysResult generateDocx(@RequestBody Traffic traffic) {
        String result = jtybService.generateDocx(traffic);
        return SysResult.success(result);
    }



}
